<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0">
<link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
<title>source\jindo.MultipleAjaxRequest.js - Jindo Component - AjaxUI@NHN</title>
<link rel="stylesheet" type="text/css" href="../assets/prettify/prettify-min.css" media="screen">
<script type="text/javascript">
	var isMobile = (function() {
		var r = window.devicePixelRatio || 1;
		if (/windows phone/i.test(navigator.userAgent)) { r = 2; }
		
		var s = Math.max(screen.width / r, screen.height / r);
		
		var m = s < 1024;
		var href = m ? "api.mobile.css" : "api.css";
		document.write('<link rel="stylesheet" type="text/css" href="../assets/' + href + '" media="screen">');
		
		return m;
	})();
</script>

<script type="text/javascript" src="../assets/jindo.desktop.min.js"></script>
<script type="text/javascript" src="../assets/jindo_component.min.js"></script>
</head>
<body class="api-page">
<div id="wrap" class="api-main"><!-- 2Depth 접기 : lft_fold 추가 -->

	<div id="header">
		<h1><a href="../index.html"><span class="blind">JindoJS</span></a></h1>
		<div class="info">
			<span class="version">version 1.6.0</span>
			<span class="bar">|</span>
			<span class="help"><span class="ic_help"></span><a href="http://devcode.nhncorp.com/projects/jindo-component/issue" target="_blank">버그신고/문의</a></span>
		</div>
		<div class="menu">
			<button type="button" id="toggle_search_btn" class="btn_sch"><span class="blind">검색</span></button>
			<button type="button" id="toggle_list_btn" class="btn_snb btn_snb_on"><span class="blind">메뉴</span></button>
			<!-- [D] 클릭시 btn_sch_on,btn_snb_on 추가 -->
		</div>
	</div>

	<!-- sch_frm -->
	<div class="sch_frm hide_when_small">
		<h2 class="blind">검색</h2>
		<div class="filter">
			<input type="search" id="api-filter" placeholder="검색어를 입력하세요.">
		</div>
		<div id="search-tab" style="display:none;">
			<ul class="tabs">
			<li class="tc-tab">전체</li>
			<li class="tc-tab">키워드</li>
			<li class="tc-tab">클래스</li>
			<li class="tc-tab">메서드</li>
			<li class="tc-tab">프로퍼티</li>
			<li class="tc-tab">이벤트</li>
			</ul>
			<div class="panels">
				<ul id="api-all" class="tc-panel"></ul>
				<ul id="api-keywords" class="tc-panel"></ul>
				<ul id="api-classes" class="tc-panel"></ul>
				<ul id="api-methods" class="tc-panel"></ul>
				<ul id="api-attrs" class="tc-panel"></ul>
				<ul id="api-events" class="tc-panel"></ul>
			</div>

		</div>
	</div>
	<!-- // sch_frm -->

	<!-- container -->
	<div id="container">
		<!-- left-columns -->
		<div id="left-columns" class="sidemenu has_scrollbar">
			<h2 class="blind"><a href="../index.html"><span>APIs</span></a></h2>
<div class="snb depth1 scrollbar hide_when_small">
	<!-- [D] style="width:135px; height:384px; -->
	<div class="scrollbar-box">
		<div class="scrollbar-content">
			<div><ul>
			            <li class="">
			            	<a href="../classes/jindo.Accordion.html" class="">
			                	Accordion
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.AjaxHistory.html" class="">
			                	AjaxHistory
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.BrowseButton.html" class="">
			                	BrowseButton
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Cache.html" class="">
			                	Cache
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Calendar.html" class="">
			                	Calendar
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Canvas.html" class="">
			                	Canvas
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.CheckBox.html" class="">
			                	CheckBox
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.CircularRolling.html" class="">
			                	CircularRolling
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Clipboard.html" class="">
			                	Clipboard
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Component.html" class="">
			                	Component
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DataBridge.html" class="">
			                	DataBridge
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DatePicker.html" class="">
			                	DatePicker
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DefaultTextValue.html" class="">
			                	DefaultTextValue
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Dialog.html" class="">
			                	Dialog
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DragArea.html" class="">
			                	DragArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DropArea.html" class="">
			                	DropArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.DynamicTree.html" class="">
			                	DynamicTree
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Effect.html" class="">
			                	Effect
								
								

							    
						        
						            <span class="flag static" title="static"><span class="blind">static</span></span>
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.FileUploader.html" class="">
			                	FileUploader
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.FloatingLayer.html" class="">
			                	FloatingLayer
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Foggy.html" class="">
			                	Foggy
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Formatter.html" class="">
			                	Formatter
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.HTMLComponent.html" class="">
			                	HTMLComponent
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.InlineTextEdit.html" class="">
			                	InlineTextEdit
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LayerEffect.html" class="">
			                	LayerEffect
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LayerManager.html" class="">
			                	LayerManager
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LayerPosition.html" class="">
			                	LayerPosition
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.LazyLoading.html" class="">
			                	LazyLoading
								
								

							    
						        
						            <span class="flag static" title="static"><span class="blind">static</span></span>
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.ModalDialog.html" class="">
			                	ModalDialog
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.MouseGesture.html" class="">
			                	MouseGesture
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.MultipleAjaxRequest.html" class="">
			                	MultipleAjaxRequest
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.NumberFormatter.html" class="">
			                	NumberFormatter
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.NumericStepper.html" class="">
			                	NumericStepper
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Pagination.html" class="">
			                	Pagination
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Rolling.html" class="">
			                	Rolling
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.RollingChart.html" class="">
			                	RollingChart
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.RolloverArea.html" class="">
			                	RolloverArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.RolloverClick.html" class="">
			                	RolloverClick
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.ScrollBar.html" class="">
			                	ScrollBar
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.ScrollBox.html" class="">
			                	ScrollBox
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.SelectArea.html" class="">
			                	SelectArea
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.SelectBox.html" class="">
			                	SelectBox
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Slider.html" class="">
			                	Slider
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.StarRating.html" class="">
			                	StarRating
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.TabControl.html" class="">
			                	TabControl
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.TextRange.html" class="">
			                	TextRange
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Timer.html" class="">
			                	Timer
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Transition.html" class="">
			                	Transition
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.Tree.html" class="">
			                	Tree
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.UIComponent.html" class="">
			                	UIComponent
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.UploadQueue.html" class="">
			                	UploadQueue
								
								

							    
						        
			            	</a>
			            </li>
			        
			            <li class="">
			            	<a href="../classes/jindo.WatchInput.html" class="">
			                	WatchInput
								
								

							    
						        
			            	</a>
			            </li>
			        </ul></div>
		</div>
	</div>
	<div class="scrollbar-v">
		<div class="scrollbar-button-up"></div>
		<div class="scrollbar-track">
			<div class="scrollbar-thumb" style="top: 0px; height: 222px; "></div>
		</div>
		<div class="scrollbar-button-down"></div>
	</div>
</div>


<button type="button" title="펼치기" class="btn_open">바로가기 열기<span class="ic"></span></button>
<button type="button" title="접기" class="btn_close">바로가기 닫기<span class="ic"></span></button>

		</div>
		<!-- // left-columns -->

		<!-- main content -->
		<div id="main">
			<div class="main_fix">
				<div class="content">
	
	<h1 class="blind">source/jindo.MultipleAjaxRequest.js</h1>
	<div class="tc-panel first">
		<dl class="relation">
			<dt>파일명</dt>
			<dd>jindo.MultipleAjaxRequest.js</dd>
			<dt>경로</dt>
			<dd>source/</dd>
		</dl>
		<div id="file" class="file">
		    <pre class="code prettyprint linenums">/**
	@fileOverview&nbsp;다수의&nbsp;Ajax&nbsp;요청을&nbsp;병렬&nbsp;또는&nbsp;직렬방식으로&nbsp;요청하고&nbsp;응답을&nbsp;처리하는&nbsp;컴포넌트&nbsp;
	@author&nbsp;senxation
	@version&nbsp;#__VERSION__#
**/
/**
	다수의&nbsp;Ajax&nbsp;요청을&nbsp;병렬&nbsp;또는&nbsp;직렬방식으로&nbsp;요청하고&nbsp;응답을&nbsp;처리하는&nbsp;컴포넌트
	
	@class&nbsp;jindo.MultipleAjaxRequest
	@extends&nbsp;jindo.Component
	@keyword&nbsp;multipleajaxrequest,&nbsp;ajax,&nbsp;request,&nbsp;response,&nbsp;멀티플에이잭스리퀘스트,&nbsp;에이잭스,&nbsp;리퀘스트,&nbsp;요청,&nbsp;응답,&nbsp;직렬,&nbsp;병렬
**/
jindo.MultipleAjaxRequest&nbsp;=&nbsp;jindo.$Class({
	/**&nbsp;@lends&nbsp;jindo.MultipleAjaxRequest.prototype&nbsp;*/
	
	_bIsRequesting&nbsp;:&nbsp;false,
	
	/**
		컴포넌트를&nbsp;생성한다.
		
		@constructor
		@param&nbsp;{Object}&nbsp;[htOption]&nbsp;옵션&nbsp;Hash&nbsp;Table
			@param&nbsp;{String}&nbsp;[htOption.sMode=&quot;parallel&quot;]&nbsp;요청&nbsp;방식.&nbsp;기본은&nbsp;병렬로&nbsp;요청.&nbsp;&quot;serial&quot;일&nbsp;경우&nbsp;직렬로&nbsp;요청
		@example
			var&nbsp;oMultipleAjaxRequest&nbsp;=&nbsp;new&nbsp;jindo.MultipleAjaxRequest({&nbsp;
				sMode&nbsp;:&nbsp;&quot;parallel&quot;&nbsp;//요청&nbsp;방식.&nbsp;기본은&nbsp;병렬로&nbsp;요청.&nbsp;&quot;serial&quot;일&nbsp;경우&nbsp;직렬로&nbsp;요청
			}).attach({
				start:&nbsp;function(oCustomEvent)&nbsp;{
					//요청이&nbsp;시작될&nbsp;때&nbsp;발생
					//전달되는&nbsp;커스텀&nbsp;이벤트&nbsp;객체&nbsp;oCustomEvent&nbsp;=&nbsp;{
					//	aAjax&nbsp;:&nbsp;(Array)&nbsp;request()&nbsp;메서드에&nbsp;전달되었던&nbsp;aAjax&nbsp;배열&nbsp;
					//	htMetaData&nbsp;:&nbsp;(HashTable)&nbsp;request()&nbsp;메서드에&nbsp;전달되었던&nbsp;htMetaData
					//}
				},
				beforeEachRequest:&nbsp;function(oCustomEvent){
					//각각의&nbsp;요청&nbsp;이전에&nbsp;발생
					//전달되는&nbsp;커스텀&nbsp;이벤트&nbsp;객체&nbsp;oCustomEvent&nbsp;=&nbsp;{
					//	oAjax&nbsp;:&nbsp;(jindo.$Ajax)&nbsp;해당&nbsp;요청의&nbsp;jindo.$Ajax&nbsp;객체&nbsp;
					//	nIndex&nbsp;:&nbsp;(Number)&nbsp;요청&nbsp;순서
					//}
				},
				afterEachResponse:&nbsp;function(oCustomEvent){
					//각각의&nbsp;응답&nbsp;이후에&nbsp;발생
					//전달되는&nbsp;커스텀&nbsp;이벤트&nbsp;객체&nbsp;oCustomEvent&nbsp;=&nbsp;{
					//	oAjax&nbsp;:&nbsp;(jindo.$Ajax)&nbsp;해당&nbsp;요청의&nbsp;jindo.$Ajax&nbsp;객체&nbsp;
					//	nIndex&nbsp;:&nbsp;(Number)&nbsp;요청&nbsp;순서
					//}
				},
				complete:&nbsp;function(oCustomEvent){
					//모든&nbsp;응답이&nbsp;완료된&nbsp;이후에&nbsp;발생
					//전달되는&nbsp;커스텀&nbsp;이벤트&nbsp;객체&nbsp;oCustomEvent&nbsp;=&nbsp;{
					//	aResponse&nbsp;:&nbsp;(Array)&nbsp;모든&nbsp;요청의&nbsp;jindo.$Ajax.Response&nbsp;객체의&nbsp;배열
					//	htMetaData&nbsp;:&nbsp;(HashTable)&nbsp;request메서드에서&nbsp;선언한&nbsp;Hash&nbsp;Table&nbsp;
					//}
					
				}
			});
	**/
	$init&nbsp;:&nbsp;function(htOption){
		var&nbsp;htDefaultOption&nbsp;=&nbsp;{
			sMode&nbsp;:&nbsp;&quot;parallel&quot;&nbsp;//기본은&nbsp;병렬로&nbsp;요청.&nbsp;&quot;serial&quot;일&nbsp;경우&nbsp;직렬로&nbsp;요청
		};
		this.option(htDefaultOption);
		this.option(htOption);
	},
	
	/**
		요청이&nbsp;진행중인지&nbsp;여부를&nbsp;가져온다.
		
		@method&nbsp;isRequesting
		@return&nbsp;{Boolean}&nbsp;요청&nbsp;진행&nbsp;여부
	**/
	isRequesting&nbsp;:&nbsp;function()&nbsp;{
		return&nbsp;this._bIsRequesting;
	},
	
	/**
		요청을&nbsp;수행한다.
		
		@method&nbsp;request
		@param&nbsp;{Array}&nbsp;aAjax&nbsp;요청을&nbsp;위한&nbsp;정보를&nbsp;담은&nbsp;Hash&nbsp;Table의&nbsp;배열
		@param&nbsp;{Object}&nbsp;complete&nbsp;커스텀&nbsp;이벤트에&nbsp;전달될&nbsp;Hash&nbsp;Table
		@return&nbsp;{Boolean}&nbsp;요청이&nbsp;성공적으로&nbsp;시작되었는지&nbsp;여부
		@example
			var&nbsp;oAjax1&nbsp;=&nbsp;{
				sUrl&nbsp;:&nbsp;&quot;1.js&quot;,&nbsp;//요청할&nbsp;URL
				htOption&nbsp;:&nbsp;{&nbsp;//jindo.$Ajax의&nbsp;option객체&nbsp;(jindo.$Ajax&nbsp;참고)
					type&nbsp;:&nbsp;&quot;xhr&quot;,
					method&nbsp;:&nbsp;&quot;get&quot;
				},
				htParameter&nbsp;:&nbsp;null&nbsp;//jindo.$Ajax.request를&nbsp;수행시&nbsp;전달할&nbsp;파라미터&nbsp;Hash&nbsp;Table&nbsp;객체
			};
			
			var&nbsp;htAjax2&nbsp;=&nbsp;{
				sUrl&nbsp;:&nbsp;&quot;22.js&quot;,
				htOption&nbsp;:&nbsp;{
					type&nbsp;:&nbsp;&quot;xhr&quot;,
					method&nbsp;:&nbsp;&quot;get&quot;
				},
				htParameter&nbsp;:&nbsp;null
			};
			
			var&nbsp;htAjax3&nbsp;=&nbsp;{
				sUrl&nbsp;:&nbsp;&quot;3.js&quot;,
				htOption&nbsp;:&nbsp;{
					type&nbsp;:&nbsp;&quot;xhr&quot;,
					method&nbsp;:&nbsp;&quot;get&quot;
				},
				htParameter&nbsp;:&nbsp;null
			};
			
			oMultipleAjaxRequest.request([htAjax1,&nbsp;htAjax2,&nbsp;htAjaxhtAjax&nbsp;sRequestName&nbsp;:&nbsp;&quot;요청이름&quot;&nbsp;});
	**/
	request&nbsp;:&nbsp;function(aAjax,&nbsp;htMetaData)&nbsp;{
		if&nbsp;(this.isRequesting())&nbsp;{&nbsp;//요청이&nbsp;진행중이면&nbsp;중단한다.
			return&nbsp;false;
		}
		if&nbsp;(!(aAjax&nbsp;instanceof&nbsp;Array))&nbsp;{
			aAjax&nbsp;=&nbsp;[aAjax];
		}
		if&nbsp;(typeof&nbsp;htMetaData&nbsp;==&nbsp;&quot;undefined&quot;)&nbsp;{
			htMetaData&nbsp;=&nbsp;{};
		}
		this._htMetaData&nbsp;=&nbsp;htMetaData;
		
		switch&nbsp;(this.option(&quot;sMode&quot;))&nbsp;{
			case&nbsp;&quot;parallel&quot;&nbsp;:
				this._parallelRequest(aAjax);
				break;	
			case&nbsp;&quot;serial&quot;&nbsp;:
				this._serialRequest(aAjax);
				break;
			default&nbsp;:
				return&nbsp;false;
		}
		return&nbsp;true;
	},
	
	_fireEventStart&nbsp;:&nbsp;function()&nbsp;{
		this._bIsRequesting&nbsp;=&nbsp;true;
		
		/**
			요청이&nbsp;시작될&nbsp;때
			
			@event&nbsp;start
			@param&nbsp;{String}&nbsp;sType&nbsp;커스텀&nbsp;이벤트명
			@param&nbsp;{Array}&nbsp;aAjax&nbsp;request()&nbsp;메서드에&nbsp;전달되었던&nbsp;aAjax&nbsp;배열
			@param&nbsp;{Object}&nbsp;htMetaData&nbsp;request()&nbsp;메서드에&nbsp;전달되었던&nbsp;htMetaData
			@param&nbsp;{Function}&nbsp;stop&nbsp;수행시&nbsp;요청을&nbsp;시작하지&nbsp;않음
			@example
				//&nbsp;커스텀&nbsp;이벤트&nbsp;핸들링&nbsp;예제
				oComponent.attach(&quot;start&quot;,&nbsp;function(oCustomEvent)&nbsp;{&nbsp;...&nbsp;});
		**/
		if&nbsp;(this.fireEvent(&quot;start&quot;,&nbsp;{
			aAjax&nbsp;:&nbsp;this._aAjax,
			htMetaData&nbsp;:&nbsp;this._htMetaData
		}))&nbsp;{
			return&nbsp;true;
		}&nbsp;else&nbsp;{
			this.abort();
			return&nbsp;false;
		}
	},
	
	_fireEventBeforeEachRequest&nbsp;:&nbsp;function(nIndex)&nbsp;{
		/**
			각각의&nbsp;요청&nbsp;이전
			
			@event&nbsp;beforeEachRequest
			@param&nbsp;{String}&nbsp;sType&nbsp;커스텀&nbsp;이벤트명
			@param&nbsp;{jindo.$Ajax}&nbsp;oAjax&nbsp;해당&nbsp;요청의&nbsp;jindo.$Ajax&nbsp;객체
			@param&nbsp;{Number}&nbsp;nIndex&nbsp;요청&nbsp;순서
			@param&nbsp;{Function}&nbsp;stop&nbsp;수행시&nbsp;요청을&nbsp;시작하지&nbsp;않음
			@example
				//&nbsp;커스텀&nbsp;이벤트&nbsp;핸들링&nbsp;예제
				oComponent.attach(&quot;beforeEachRequest&quot;,&nbsp;function(oCustomEvent)&nbsp;{&nbsp;...&nbsp;});
		**/
		if&nbsp;(this.fireEvent(&quot;beforeEachRequest&quot;,&nbsp;{
			oAjax:&nbsp;this._aAjax[nIndex],
			nIndex&nbsp;:&nbsp;nIndex
		}))&nbsp;{
			return&nbsp;true;
		}&nbsp;else&nbsp;{
			this.abort();
			return&nbsp;false;
		}
	},
	
	_fireEventAfterEachResponse&nbsp;:&nbsp;function(nIndex)&nbsp;{
		/**
			각각의&nbsp;요청&nbsp;이후
			
			@event&nbsp;afterEachResponse
			@param&nbsp;{String}&nbsp;sType&nbsp;커스텀&nbsp;이벤트명
			@param&nbsp;{jindo.$Ajax}&nbsp;oAjax&nbsp;해당&nbsp;요청의&nbsp;jindo.$Ajax&nbsp;객체
			@param&nbsp;{Number}&nbsp;nIndex&nbsp;요청&nbsp;순서
			@param&nbsp;{Function}&nbsp;stop&nbsp;수행시&nbsp;더이상&nbsp;요청이&nbsp;진행되지&nbsp;않고&nbsp;모든&nbsp;응답이&nbsp;완료되어도&nbsp;complete&nbsp;커스텀&nbsp;이벤트&nbsp;발생하지&nbsp;않음
			@example
				//&nbsp;커스텀&nbsp;이벤트&nbsp;핸들링&nbsp;예제
				oComponent.attach(&quot;afterEachRequest&quot;,&nbsp;function(oCustomEvent)&nbsp;{&nbsp;...&nbsp;});
		**/
		if&nbsp;(this.fireEvent(&quot;afterEachResponse&quot;,&nbsp;{
			oAjax:&nbsp;this._aAjax[nIndex],
			nIndex&nbsp;:&nbsp;nIndex
		}))&nbsp;{
			return&nbsp;true;
		}&nbsp;else&nbsp;{
			this.abort();
			return&nbsp;false;
		}
	},
	
	/**
		병렬&nbsp;요청
		@param&nbsp;{Array}&nbsp;aAjax
		@ignore
	**/
	_parallelRequest&nbsp;:&nbsp;function(aAjax)&nbsp;{
		this._aAjaxData&nbsp;=&nbsp;aAjax;
		
		this._aAjax&nbsp;=&nbsp;[];&nbsp;//Ajax&nbsp;객체의&nbsp;배열
		this._aStatus&nbsp;=&nbsp;[];&nbsp;//요청을&nbsp;보냈는지&nbsp;여부
		this._aStatus.length&nbsp;=&nbsp;aAjax.length;
		this._aResponse&nbsp;=&nbsp;[];&nbsp;//응답객체
		
		if&nbsp;(this._fireEventStart())&nbsp;{
			var&nbsp;self&nbsp;=&nbsp;this;
			jindo.$A(this._aAjaxData).forEach(function(htAjax,&nbsp;i){
				var&nbsp;fParallelResponseHandler&nbsp;=&nbsp;function(oResponse){
					oResponse._constructor&nbsp;=&nbsp;self._aAjax[i];
					var&nbsp;nIndex&nbsp;=&nbsp;self._findAjaxObjectIndexOfResponse(oResponse._constructor);
					self._aResponse[nIndex]&nbsp;=&nbsp;oResponse;
					self._aStatus[nIndex]&nbsp;=&nbsp;true;
					
					if&nbsp;(self._fireEventAfterEachResponse(nIndex))&nbsp;{
						if&nbsp;(self._hasCompletedGotResponsesOfParallelResponses())&nbsp;{
							self._complete();
						}	
					}
				};
				self._aAjax.push(jindo.$Ajax(htAjax.sUrl,&nbsp;htAjax.htOption));
				htAjax.htOption.onload&nbsp;=&nbsp;fParallelResponseHandler;
				htAjax.htOption.onerror&nbsp;=&nbsp;fParallelResponseHandler;
				htAjax.htOption.ontimeout&nbsp;=&nbsp;fParallelResponseHandler;
				self._aAjax[i].option(htAjax.htOption);
				
				if&nbsp;(self._fireEventBeforeEachRequest(i)){
					self._aAjax[i].request(htAjax.htParameter&nbsp;||&nbsp;{});	
				}&nbsp;else&nbsp;{
					jindo.$A.Break();
				}
			});
		}
		
	},
	
	/**
		병렬&nbsp;요청시&nbsp;응답이&nbsp;몇번째&nbsp;Ajax&nbsp;요청에&nbsp;대한&nbsp;응답인지&nbsp;찾는다.
		@param&nbsp;{Object}&nbsp;oAjax
		@return&nbsp;{Number}
	**/
	_findAjaxObjectIndexOfResponse&nbsp;:&nbsp;function(oAjax)&nbsp;{
		return&nbsp;jindo.$A(this._aAjax).indexOf(oAjax);
	},
	
	/**
		병렬&nbsp;요청의&nbsp;응답이&nbsp;모두&nbsp;완료되었는지&nbsp;확인한다.
	**/
	_hasCompletedGotResponsesOfParallelResponses&nbsp;:&nbsp;function()&nbsp;{
		var&nbsp;bResult&nbsp;=&nbsp;true;
		jindo.$A(this._aStatus).forEach(function(bStatus){
			if&nbsp;(!bStatus)&nbsp;{
				bResult&nbsp;=&nbsp;false;
				jindo.$A.Break();
			}&nbsp;
		});
		return&nbsp;bResult;
	},
	
	/**
		직렬&nbsp;요청
		@param&nbsp;{Array}&nbsp;aAjax
		@ignore
	**/
	_serialRequest&nbsp;:&nbsp;function(aAjax)&nbsp;{
		this._aAjaxData&nbsp;=&nbsp;aAjax;
		
		this._aAjax&nbsp;=&nbsp;[];&nbsp;//Ajax&nbsp;객체의&nbsp;배열
		this._aStatus&nbsp;=&nbsp;[];&nbsp;//요청을&nbsp;보냈는지&nbsp;여부
		this._aStatus.length&nbsp;=&nbsp;aAjax.length;
		this._aResponse&nbsp;=&nbsp;[];&nbsp;//응답객체
		
		var&nbsp;self&nbsp;=&nbsp;this;
		jindo.$A(this._aAjaxData).forEach(function(htAjax,&nbsp;i){
			var&nbsp;fSerialRequestHandler&nbsp;=&nbsp;function(e){
				e._constructor&nbsp;=&nbsp;self._aAjax[i];
				self._aResponse.push(e);
				self._serialRequestNext();
			};
			self._aAjax.push(jindo.$Ajax(htAjax.sUrl,&nbsp;htAjax.htOption));
			htAjax.htOption.onload&nbsp;=&nbsp;fSerialRequestHandler;
			htAjax.htOption.onerror&nbsp;=&nbsp;fSerialRequestHandler;
			htAjax.htOption.ontimeout&nbsp;=&nbsp;fSerialRequestHandler;
			self._aAjax[i].option(htAjax.htOption);
		});
		
		if&nbsp;(this._fireEventStart())&nbsp;{
			if&nbsp;(this._fireEventBeforeEachRequest(0))&nbsp;{
				this._aAjax[0].request(this._aAjaxData[0].htParameter&nbsp;||&nbsp;{});
				this._aStatus[0]&nbsp;=&nbsp;true;
			}
		}
	},
	
	/**
		직렬&nbsp;요청시&nbsp;다음&nbsp;요청을&nbsp;수행하거나&nbsp;응답&nbsp;완료
		@param&nbsp;{Array}&nbsp;aAjax
		@ignore
	**/
	_serialRequestNext&nbsp;:&nbsp;function()&nbsp;{
		var&nbsp;nIndex&nbsp;=&nbsp;-1;
		for&nbsp;(var&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;this._aStatus.length;&nbsp;i++)&nbsp;{
			if(!this._aStatus[i])&nbsp;{
				this._aStatus[i]&nbsp;=&nbsp;true;
				nIndex&nbsp;=&nbsp;i;
				break;
			}
		}
		
		if&nbsp;(nIndex&nbsp;&gt;&nbsp;0)&nbsp;{
			if&nbsp;(this._fireEventAfterEachResponse(nIndex&nbsp;-&nbsp;1))&nbsp;{
				if&nbsp;(this._fireEventBeforeEachRequest(nIndex))&nbsp;{
					this._aAjax[nIndex].request(this._aAjaxData[nIndex].htParameter&nbsp;||&nbsp;{});
				}
			}
		}&nbsp;else&nbsp;if&nbsp;(nIndex&nbsp;==&nbsp;-1)&nbsp;{
			if&nbsp;(this._fireEventAfterEachResponse(this._aStatus.length&nbsp;-&nbsp;1))&nbsp;{
				this._complete();
			}
		}
	},
	
	/**
		요청정보들을&nbsp;초기화한다.
		@ignore
	**/
	_reset&nbsp;:&nbsp;function()&nbsp;{
		this._aAjaxData.length&nbsp;=&nbsp;0;
		this._aAjax.length&nbsp;=&nbsp;0;
		this._aStatus.length&nbsp;=&nbsp;0;
		this._aResponse.length&nbsp;=&nbsp;0;
		this._htMetaData&nbsp;=&nbsp;null;
		
		delete&nbsp;this._aAjaxData;
		delete&nbsp;this._aAjax;
		delete&nbsp;this._aStatus;
		delete&nbsp;this._aResponse;
		delete&nbsp;this._htMetaData;
		
		this._bIsRequesting&nbsp;=&nbsp;false;
	},
	
	/**
		요청을&nbsp;중단한다.
		
		@method&nbsp;abort
		@remark&nbsp;다수의&nbsp;요청중에&nbsp;현재까지의&nbsp;모든&nbsp;요청이&nbsp;중단되고,&nbsp;수행되지&nbsp;않은&nbsp;요청은&nbsp;더&nbsp;이상&nbsp;진행되지&nbsp;않는다.
	**/
	abort&nbsp;:&nbsp;function()&nbsp;{
		jindo.$A(this._aAjax).forEach(function(oAjax){
			oAjax.abort();
		});
		this._reset();
	},
	
	/**
		응답이&nbsp;완료되었을때&nbsp;수행되어&nbsp;완료&nbsp;이벤트(complete)를&nbsp;발생
		@ignore
	**/
	_complete&nbsp;:&nbsp;function()&nbsp;{
		var&nbsp;aResponse&nbsp;=&nbsp;this._aResponse.concat(),
			htMetaData&nbsp;=&nbsp;{},
			sProp;
		for&nbsp;(sProp&nbsp;in&nbsp;this._htMetaData)&nbsp;{
			htMetaData[sProp]&nbsp;=&nbsp;this._htMetaData[sProp];
		}
		
		this._reset();
		/**
			모든&nbsp;응답이&nbsp;완료된&nbsp;이후
			
			@event&nbsp;complete
			@param&nbsp;{String}&nbsp;sType&nbsp;커스텀&nbsp;이벤트명
			@param&nbsp;{Array}&nbsp;aResponse&nbsp;모든&nbsp;요청의&nbsp;jindo.$Ajax.Response&nbsp;객체의&nbsp;배열
			@param&nbsp;{Object}&nbsp;htMetaData&nbsp;request메서드에서&nbsp;선언한&nbsp;Hash&nbsp;Table
			@example
				//&nbsp;커스텀&nbsp;이벤트&nbsp;핸들링&nbsp;예제
				oComponent.attach(&quot;complete&quot;,&nbsp;function(oCustomEvent)&nbsp;{&nbsp;...&nbsp;});
		**/
		this.fireEvent(&quot;complete&quot;,&nbsp;{
			aResponse&nbsp;:&nbsp;aResponse,
			htMetaData&nbsp;:&nbsp;htMetaData
		});	
	}

}).extend(jindo.Component);	</pre>
		</div>
	</div>
</div>

			</div>
		</div>
		<!-- // main content -->

	</div>
	<!-- // container -->

	<!-- footer -->
	<div id="footer">
		<p>Copyright ©<a href="http://nhncorp.com/" target="_blank">NHN Corp.</a> Platform Ajax Team. All Rights Reserved.</p>
	</div>
	<!-- // footer -->

</div>
<!-- // wrap -->

<style type="text/css">

	.item {
		transition:background .2s linear;
		-webkit-transition:background .2s linear;
		-moz-transition:background .2s linear;
		-o-transition:background .2s linear;
		-ms-transition:background .2s linear;
	}
	
	.highlight {
		background-color:#ffffd8 !important;
	}
	
	li.selected a.highlight {
		background-color:#aa8 !important;
	}
	
	.hide-deprecated .deprecated-item, .hide-inherited .inherited-item, .private {
		display:none;
	}
	
	.scrollbar-v, .scrollbar-h { display:none; }
	.scrollbar-show { display:block; }
	
	.api-page .tbl_fold .more_history { display:none; }
	
	/* FILE */
	.file pre.code {
		border:1px solid #ccc;
		padding:0;
	}
	
	.file ol {
		padding-left: 4em;
		background-color: #f9f9f9;
	}

	.file ol li {
		list-style: decimal;
		border-left:1px solid #ccc;
		padding:2px 4px;
	}
	
	.file li.L1, .file li.L3, .file li.L5, .file li.L7, .file li.L9 {
		background-color: #f9f9f9;	
	}

	.file li.L0, .file li.L2, .file li.L4, .file li.L6, .file li.L8 { 
		background-color: #f0f0f0;
	}
	
</style>
<script type="text/javascript" src="../assets/prettify/prettify-min.js"></script>
<script type="text/javascript" src="../assets/hash.js"></script>
<script type="text/javascript" src="../assets/api-list.js"></script>
<script type="text/javascript" src="../assets/api-search.js"></script>
<script type="text/javascript" src="../assets/../api.js?callback=APISearch.setData"></script>
<script type="text/javascript">
	var projectRoot = "../";
	var projectAssets = "../assets";
	
    apiDocs(projectAssets);	
</script>
</body>
</html>